<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>axipcie: xaxipcie_rc_enumerate_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">axipcie
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxipcie__rc__enumerate__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxipcie_rc_enumerate_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example for using AXI PCIe IP and its driver. </p>
<p>This is an example to show the usage of driver APIs when AXI PCIe IP is configured as a Root Port. The AXI PCIe can be configured as a Root Port only on the 7 Series Xilinx FPGA families.</p>
<p>The example initialises the AXI PCIe IP and shows how to enumerate the PCIe system.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This example should be used only when AXI PCIe IP is configured as root complex.</p>
<p>This code will illustrate how the <a class="el" href="struct_x_axi_pcie.html" title="The XAxiPcie driver instance data. ">XAxiPcie</a> IP and its standalone driver can be used to:</p><ul>
<li>Initialize a AXI PCIe IP core built as a root complex</li>
<li>Enumerate PCIe end points in the system</li>
</ul>
<p>Please note that this example enumerates and initializes PCIe end points only. It does not shows how to deal with PCIe switches (and its virtual P2P bridges)</p>
<p>We tried to use as much of the driver's API calls as possible to show the reader how each call could be used and that probably made the example not the shortest way of doing the tasks shown as they could be done.</p>
<pre>
  MODIFICATION HISTORY:</pre><pre>  Ver   Who  Date     Changes
<hr/>

  2.00a nm   10/19/11 Initial version of AXI PCIe root complex example
  2.02a nm   08/19/12 Removed the calls to XAxiPcie_GetLocalBusBar2PcieBar
                      and XAxiPcie_SetLocalBusBar2PcieBar as they are not
                      needed for enumeration
  3.1   ms   01/23/17 Added xil_printf statement in main function to
                      ensure that "Successfully ran" and "Failed" strings
                      are available in all examples. This is a fix for
                      CR-965028.</pre><pre>*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae4d64f629bd35e874ac76b2e7159b73f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__rc__enumerate__example_8c.html#ae4d64f629bd35e874ac76b2e7159b73f">PcieInitRootComplex</a> (<a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *AxiPciePtr, u16 DeviceId)</td></tr>
<tr class="memdesc:ae4d64f629bd35e874ac76b2e7159b73f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes a AXI PCIe IP built as a root complex.  <a href="#ae4d64f629bd35e874ac76b2e7159b73f">More...</a><br /></td></tr>
<tr class="separator:ae4d64f629bd35e874ac76b2e7159b73f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01838eb2ef6647eade95ec664ea99543"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__rc__enumerate__example_8c.html#a01838eb2ef6647eade95ec664ea99543">PCIeEnumerateFabric</a> (<a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *AxiPciePtr)</td></tr>
<tr class="memdesc:a01838eb2ef6647eade95ec664ea99543"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function enumerates its PCIe system and figures out the nature of each component there like end points,bridges,...  <a href="#a01838eb2ef6647eade95ec664ea99543">More...</a><br /></td></tr>
<tr class="separator:a01838eb2ef6647eade95ec664ea99543"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxipcie__rc__enumerate__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the entry point for PCIe Root Complex Enumeration Example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the entry point for PCIe Root Complex Enumeration Example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful<ul>
<li>XST_FAILURE if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xaxipcie__rc__enumerate__example_8c.html#ae4d64f629bd35e874ac76b2e7159b73f">PcieInitRootComplex()</a>.</p>

</div>
</div>
<a id="a01838eb2ef6647eade95ec664ea99543"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01838eb2ef6647eade95ec664ea99543">&#9670;&nbsp;</a></span>PCIeEnumerateFabric()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PCIeEnumerateFabric </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *&#160;</td>
          <td class="paramname"><em>AxiPciePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function enumerates its PCIe system and figures out the nature of each component there like end points,bridges,... </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiPciePtr</td><td>is a pointer to an instance of <a class="el" href="struct_x_axi_pcie.html" title="The XAxiPcie driver instance data. ">XAxiPcie</a> data structure represents a root complex IP.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="ae4d64f629bd35e874ac76b2e7159b73f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4d64f629bd35e874ac76b2e7159b73f">&#9670;&nbsp;</a></span>PcieInitRootComplex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int PcieInitRootComplex </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_pcie.html">XAxiPcie</a> *&#160;</td>
          <td class="paramname"><em>AxiPciePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes a AXI PCIe IP built as a root complex. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiPciePtr</td><td>is a pointer to an instance of <a class="el" href="struct_x_axi_pcie.html" title="The XAxiPcie driver instance data. ">XAxiPcie</a> data structure represents a root complex IP. </td></tr>
    <tr><td class="paramname">DeviceId</td><td>is AXI PCIe IP unique ID</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if successful.<ul>
<li>XST_FAILURE if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_axi_pcie___config.html#a98bdcba67cfa7c75179ae1b0b7b6415f">XAxiPcie_Config::BaseAddress</a>, <a class="el" href="struct_x_axi_pcie.html#ab87e6544d15c1c11d8aaba5021606363">XAxiPcie::Config</a>, <a class="el" href="struct_x_axi_pcie___config.html#a9cf8eebd3200725c2102ea9c1a5aea28">XAxiPcie_Config::IncludeRootComplex</a>, <a class="el" href="group__axipcie__v3__0.html#ga6eaa13c68af6eb2ca12ae556f9e0769b">XAxiPcie_CfgInitialize()</a>, <a class="el" href="group__axipcie__v3__0.html#gabdf66d0cb481a5eea62e1f98e71d9520">XAxiPcie_ClearPendingInterrupts()</a>, <a class="el" href="group__axipcie__v3__0.html#gae238cf115bd039e0f7228e385c893aad">XAxiPcie_DisableInterrupts()</a>, <a class="el" href="group__axipcie__v3__0.html#gae118e9d7fd6b78ca0b8d4fd6694f9808">XAxiPcie_GetEnabledInterrupts()</a>, <a class="el" href="group__axipcie__v3__0.html#gaec39c65db1aeac38798a250a25298208">XAxiPcie_GetPendingInterrupts()</a>, <a class="el" href="group__axipcie__v3__0.html#ga77063428b5641d07910419770813c148">XAxiPcie_GetRequesterId()</a>, <a class="el" href="group__axipcie__v3__0.html#gaeb7c330e5d10623ceafc66dd08f149ea">XAXIPCIE_ID_CLEAR_ALL_MASK</a>, <a class="el" href="group__axipcie__v3__0.html#ga40d5e3c669642af8441aed4d5ad23ee2">XAXIPCIE_IM_ENABLE_ALL_MASK</a>, <a class="el" href="group__axipcie__v3__0.html#ga08e3f639ed3ca042d429630fec260654">XAxiPcie_IsLinkUp</a>, <a class="el" href="group__axipcie__v3__0.html#ga911e4cd0c119271f6c01c9b1ac827df1">XAxiPcie_LookupConfig()</a>, and <a class="el" href="group__axipcie__v3__0.html#gad9494095b9350f455af9e7da5375d522">XAxiPcie_ReadLocalConfigSpace()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xaxipcie__rc__enumerate__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
